package com.yuyou.fn.tms.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yuyou.fn.common.util.TimeUtils;
import com.yuyou.fn.educational.entity.AttendClassLecture;
import com.yuyou.fn.educational.entity.CourseClass;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;

/**
 * Created by lzh on 2019/1/23.
 */
public class TmsClassLecture {
    @ApiModelProperty("排课id")
    private Long currId ;//排课id

    @ApiModelProperty("班级id")
    private Long currClaId ;//班级id

    @ApiModelProperty("班级编号")
    private String currClaNo ;//班级编号

    @ApiModelProperty("班级名称")
    private String currClaName ;//班级名称

    @ApiModelProperty("上课日期")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    private Date currClaDate ;//上课日期

    @ApiModelProperty("上课时间")
    private String currStartTime ;//上课时间

    @ApiModelProperty("下课时间")
    private String currEndtime ;//下课时间

    @ApiModelProperty("教师id")
    private Long currTeacherId ;//教师id

    @ApiModelProperty("教师名称")
    private String currTeacherName ;//教师名称

    @ApiModelProperty("状态（0未上课；1已上课;2 停课顺延;3 停课 ）")
    private Integer currStatus ;//状态（0未上课；1已上课;2 停课顺延;3 停课 ）

    @ApiModelProperty("是否删除（0未删除；1已删除）")
    private Integer currIsDelete ;//是否删除（0未删除；1已删除）

    @ApiModelProperty("教室id")
    private Long currRoomId ;//教室id

    @ApiModelProperty("教室名称")
    private String currRoomName ;//教室名称

    @ApiModelProperty("时长(分钟)")
    private int curLong ;//时长(分钟)

    @ApiModelProperty("课次")
    private Integer currNo ;//课次

    @ApiModelProperty("教师的角色，0主讲，1临时接任，2中途代课")
    private Integer currTeaRole ;//教师的角色，0主讲，1临时接任，2中途代课

    @ApiModelProperty("创建时间")
    private Date currCreateTime ;//创建时间

    @ApiModelProperty("修改时间")
    private Date currModifyTime ;//修改时间

    public TmsClassLecture(AttendClassLecture classLecture, CourseClass courseClass){
        Long mainTeacherId=courseClass.getTeacherId()==null?0l:courseClass.getTeacherId();
        Long teacherId=classLecture.getTeacherId()==null?0l:classLecture.getTeacherId();
        this.setCurrId(classLecture.getClassLectureId());//排课id
        this.setCurrClaId(classLecture.getClassId());//班级id
        this.setCurrClaNo(courseClass.getClassNo());//班级编号
        this.setCurrClaName(courseClass.getClassName());//班级名称
        this.setCurrClaDate(classLecture.getClassDate());//上课日期
        this.setCurrStartTime(classLecture.getStartTime());//上课时间
        this.setCurrEndtime(classLecture.getEndTime());//下课时间
        this.setCurrTeacherId(classLecture.getTeacherId());//教师id
        this.setCurrTeacherName(classLecture.getTeacherName());//教师名称
        this.setCurrStatus(classLecture.getAttendanceStatus());//状态（0未上课；1已上课;2 停课顺延;3 停课 ）
        this.setCurrIsDelete(0);//是否删除（0未删除；1已删除）
        this.setCurrRoomId(courseClass.getRoomId());//教室id
        this.setCurrRoomName(courseClass.getRoomName());//教室名称
        this.setCurLong(TimeUtils.countMinByTimeStr(classLecture.getStartTime(),classLecture.getEndTime()));//时长(分钟)
        this.setCurrNo(classLecture.getLectureNo());//课次
        this.setCurrTeaRole(mainTeacherId.equals(teacherId)?0:2);//教师的角色，0主讲，1临时接任，2中途代课
        this.setCurrCreateTime(classLecture.getCreateTime());//创建时间
        this.setCurrModifyTime(classLecture.getUpdateTime());//修改时间
    }

    public Long getCurrId() {
        return currId;
    }

    public void setCurrId(Long currId) {
        this.currId = currId;
    }

    public Long getCurrClaId() {
        return currClaId;
    }

    public void setCurrClaId(Long currClaId) {
        this.currClaId = currClaId;
    }

    public String getCurrClaNo() {
        return currClaNo;
    }

    public void setCurrClaNo(String currClaNo) {
        this.currClaNo = currClaNo;
    }

    public String getCurrClaName() {
        return currClaName;
    }

    public void setCurrClaName(String currClaName) {
        this.currClaName = currClaName;
    }

    public Date getCurrClaDate() {
        return currClaDate;
    }

    public void setCurrClaDate(Date currClaDate) {
        this.currClaDate = currClaDate;
    }

    public String getCurrStartTime() {
        return currStartTime;
    }

    public void setCurrStartTime(String currStartTime) {
        this.currStartTime = currStartTime;
    }

    public String getCurrEndtime() {
        return currEndtime;
    }

    public void setCurrEndtime(String currEndtime) {
        this.currEndtime = currEndtime;
    }

    public Long getCurrTeacherId() {
        return currTeacherId;
    }

    public void setCurrTeacherId(Long currTeacherId) {
        this.currTeacherId = currTeacherId;
    }

    public String getCurrTeacherName() {
        return currTeacherName;
    }

    public void setCurrTeacherName(String currTeacherName) {
        this.currTeacherName = currTeacherName;
    }

    public Integer getCurrStatus() {
        return currStatus;
    }

    public void setCurrStatus(Integer currStatus) {
        this.currStatus = currStatus;
    }

    public Integer getCurrIsDelete() {
        return currIsDelete;
    }

    public void setCurrIsDelete(Integer currIsDelete) {
        this.currIsDelete = currIsDelete;
    }

    public Long getCurrRoomId() {
        return currRoomId;
    }

    public void setCurrRoomId(Long currRoomId) {
        this.currRoomId = currRoomId;
    }

    public String getCurrRoomName() {
        return currRoomName;
    }

    public void setCurrRoomName(String currRoomName) {
        this.currRoomName = currRoomName;
    }

    public int getCurLong() {
        return curLong;
    }

    public void setCurLong(int curLong) {
        this.curLong = curLong;
    }

    public Integer getCurrNo() {
        return currNo;
    }

    public void setCurrNo(Integer currNo) {
        this.currNo = currNo;
    }

    public Integer getCurrTeaRole() {
        return currTeaRole;
    }

    public void setCurrTeaRole(Integer currTeaRole) {
        this.currTeaRole = currTeaRole;
    }

    public Date getCurrCreateTime() {
        return currCreateTime;
    }

    public void setCurrCreateTime(Date currCreateTime) {
        this.currCreateTime = currCreateTime;
    }

    public Date getCurrModifyTime() {
        return currModifyTime;
    }

    public void setCurrModifyTime(Date currModifyTime) {
        this.currModifyTime = currModifyTime;
    }
}
